package com.szholly.pro.watergas_server.ps.android.service;

import java.util.ArrayList;
import java.util.List;

import com.szholly.pro.watergas_server.common.data.DataUtil;
import com.szholly.data.general.GlobalParameter;
import com.szholly.data.general.RowBase;

public class UserService {
	/**
	 * 获取groupId 组id
	 * @param userId 用户id
	 * @return
	 */
	public static String getGroupIdByUserId(String userId) {
		List<GlobalParameter> parms = new ArrayList<GlobalParameter>();
		parms.add(new GlobalParameter("userId", userId));
		String sql = "select GROUP_ID from OC_GROUP_ASSO WHERE USER_ID = @userId";
		try {
			List<RowBase> rows = DataUtil.getSelectRows(sql, parms);
			return rows.get(0).getSafeString("GROUP_ID");
		} catch (Exception e) {
			return null;
		}
	}
}
